Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
-
None
-
Windows 7
Description
I have the following model:
public class Account: Entity
{
public string Email
public string Name { get; set; }
public string Designation
{ get; set; }public string Telephone { get; set; }
public string Mobile
{ get; set; }public string CompanyId { get; set; }
}
public class Store : Entity
{
[Required]
[DataMember]
public string Name
[Required]
[DataMember]
public string Address1 { get; set; }
[DataMember]
public string Address2
[Required]
[DataMember]
public string City { get; set; }
[DataMember]
[DisplayName("State/Province")]
public string State
[Required]
[DataMember]
public int Zip { get; set; }
[DataMember]
public string CompanyId
}
And the following repository:
public class AccountRepository : MongoRepository<Account> , IAccountRepository {}
public class StoreRepository : MongoRepository<Store>, IStoreRepository{}
When i try to add an item to the account with the code below, an instance is also added to the store. What code be the cause of the store addition? I have debug my code to ensure that there are no call to StoreRepository add. Thanks in advance.
AccountRepository repo = new AccountRepository();
repo.Add(new Got2FindMe.Infrastracture.Model.Account
);