public ServiceResponse <Data.Models.Partner> UpdatePartner(Data.Models.Partner partner) { try { _db.Partners.Update(partner); _db.SaveChanges(); return(new ServiceResponse <Data.Models.Partner> { IsSuccess = true, Message = "New Partner Updated", Time = DateTime.UtcNow, Data = partner }); } catch (Exception e) { return(new ServiceResponse <Data.Models.Partner> { IsSuccess = false, Message = e.StackTrace, Time = DateTime.UtcNow, Data = null }); } }
public static PartnerModel SerializePartner(Data.Models.Partner partner) { return(new PartnerModel { UsernameId = partner.UsernameId, ProgramId = partner.ProgramId, PartnerName = partner.PartnerName, Location = partner.Location, CaretakerName = partner.CaretakerName, CaretakerPhoneNumber = partner.CaretakerPhoneNumber, Password = partner.Password, UploadLink = partner.UploadLink }); }