public void UpdateTypeOfObject(TypeOfObject_Infra inst) { var tempInst = context.Types.FirstOrDefault(_ => _.Id == inst.Id); tempInst.Id = inst.Id; tempInst.TitleOfTypeOfObject = inst.TitleOfTypeOfObject; tempInst.DescriptionOfTypeOfObject = inst.DescriptionOfTypeOfObject; context.SaveChanges(); }
public static TypeOfObject_Domain TypeOfObjectFromInfraToDomain(this TypeOfObject_Infra @this) { if (@this != null) { return(new TypeOfObject_Domain() { Id = @this.Id, TitleOfTypeOfObject = @this.TitleOfTypeOfObject, ImgSrc = @this.ImgSrc, DescriptionOfTypeOfObject = @this.DescriptionOfTypeOfObject }); } else { return(null); } }
public void CreateTypeOfObject(TypeOfObject_Infra inst) { context.Types.Add(inst); context.SaveChanges(); }