Имам следния модел:
public class Customer
{
public int Id {get; set;}
public string Name {get; set;}
public int AddressId {get; set;}
public virtual Address Address {get; set;}
public virtual ICollection<CustomerCategory> Categories {get; set;}
}
public class CustomerCategory
{
public int Id {get; set;}
public int CustomerId {get; set;}
public int CategoryId {get; set;}
public virtual Category Category {get; set;}
}
public class Address
{
public int Id {get; set;}
public string Street{get; set;}
public virtual PostCode PostCode {get; set;}
}
От горното и с помощта на GraphDiff искам да актуализирам агрегата на клиентите, както следва:
dbContext.UpdateGraph<Customer>(entity,
map => map.AssociatedEntity(x => x.Address)
.OwnedCollection(x => x.Categories, with => with.AssociatedEntity(x => x.Category)));
Но горното не актуализира нищо!!
Какъв е правилният начин за използване на GraphDiff в този случай?
EntityGraphOperations
библиотека. Използва се много лесно. И автоматично дефинира състоянията на всички обекти и използва свободен синтаксис. - person Farhad Jabiyev   schedule 14.09.2016