public void UpdatePhoto(Photo_Infra inst) { var tempInst = context.Photos.FirstOrDefault(_ => _.Id == inst.Id); tempInst.Id = inst.Id; tempInst.ImgSrc = inst.ImgSrc; tempInst.Repareobject_InfraId = inst.Repareobject_InfraId; context.SaveChanges(); }
public static Photo_Domain PhotoFromInfraToDomain(this Photo_Infra @this) { if (@this != null) { return(new Photo_Domain() { Id = @this.Id, ImgSrc = @this.ImgSrc, ImgSrcMini = @this.ImgSrcMini, Repareobject_DomainId = @this.Repareobject_InfraId }); } else { return(null); } }
public void CreatePhoto(Photo_Infra inst) { context.Photos.Add(inst); context.SaveChanges(); }