public static Sphere GetORMEntity(this DALSphere DalEntity) { if (DalEntity == null) { throw new ArgumentNullException($"{DalEntity} is null!"); } return(new Sphere() { Id = DalEntity.Id, Name = DalEntity.Name, //IdCategory = DalEntity.IdCategory, }); }
public static BLLSphere GetBLLEntity(DALSphere dalEntity) { if (dalEntity == null) { throw new ArgumentNullException(); } return(new BLLSphere() { Id = dalEntity.Id, Name = dalEntity.Name, Level = dalEntity.Level, CategoryName = dalEntity.CategoryName, }); }
public IEnumerable <DALProgrammer> GetUsersWithSphere(DALSphere sphere) { return(context.Set <Programmer_Sphere>().Where(pr => pr.IdSphere == sphere.Id).Select(pr => pr.Programmer.GetDALEntity())); }
public void UpDate(DALSphere e) { context.Entry(e.GetORMEntity()).State = EntityState.Modified; }
public void Delete(DALSphere e) { context.Set <Sphere>().Attach(e.GetORMEntity()); context.Set <Sphere>().Remove(e.GetORMEntity()); }
public void Create(DALSphere e) { context.Set <Sphere>().Add(e.GetORMEntity()); }