Issues after implementing interfaces

Thread is closed for posting
1 posts, 0 answers
  1. Matt
    Matt avatar
    1 posts
    Member since:
    Dec 2015

    Posted 23 Dec 2015 Link to this post

    We had a working data access metadata class that was able to push and pull our class data from a SQL database without any issue. Our classes are set up in such a way that they are associated from bottom to top. This means class D has a reference to an instance of class C, and C to B, and B to A.


    Previously our classes looked something like this:


    public class D{
     public C classLink{get; set;}
     public int CiD {get; set;}
    public class C{
     public B classLink{get; set;}
     public int BiD {get; set;}

    This worked great and in the database the table for D would have a column for CiD which would be the FK to the primary key ID in class C. This is repeated up the chain until we get to class A.

     We recently, however, made the switch over to interfaces with a simple example of what we did as follows:


    public interface IClassD{
     int CiD {get; set;}
     C classLink {get; set;}
    public interface IClassC{
     int BiD {get; set;}
     B classLink {get; set;}

     We then refactored our code to match the  new interface implementation and we rebuilt the database after applying the changes listed here:

    The database was rebuilt just fine with no errors. Our problem comes when we try to repopulate the database with data again. Previously before we used interfaces we were able to post a single instance of class A and it would cascade, posting all associated B, C, and D class instance data at the same time. Now, however, the only data that is posted to the database is the data for class A and it never cascades. What would cause this?



Back to Top