public bool Post(M.ParametroPutFile parametroPutFile) { bool state = false; try { O.MediaOtherPerson mediaOtherPerson = BD.MediaOtherPersons.FirstOrDefault(x => x.Id == parametroPutFile.Id); mediaOtherPerson.FileName = parametroPutFile.FileName; mediaOtherPerson.DownloadLink = parametroPutFile.DownloadURL; BD.SaveChanges(); state = true; } catch { state = false; } return(state); }
public string Post(int idMediaOtherPerson) { string R = ""; try { O.MediaOtherPerson BDMediaOtherPerson = BD.MediaOtherPersons.FirstOrDefault(x => x.Id == idMediaOtherPerson); BD.MediaOtherPersons.Remove(BDMediaOtherPerson); BD.SaveChanges(); R = BDMediaOtherPerson.FileName; } catch {} return(R); }
public long Post(M.MediaOtherPerson mediaOtherPerson) { O.MediaOtherPerson BDMediaOtherPerson = new O.MediaOtherPerson { FileName = "", DownloadLink = "", LoadDate = System.DateTime.Now.ToString("g"), LoadHourZone = System.TimeZoneInfo.Local.ToString(), IdOtherPerson = mediaOtherPerson.IdOtherPerson }; BD.MediaOtherPersons.Add(BDMediaOtherPerson); BD.SaveChanges(); return(BDMediaOtherPerson.Id); }