public async Task <DbSiteOptions> CreateAsync(DbSiteOptions site) { using (var context = new EFContext()) { context.Sites.Add(site); await context.SaveChangesAsync(); return(site); } }
public async Task <bool> UpdateAsync(DbSiteOptions site) { using (var context = new EFContext()) { if (await context.Sites.AnyAsync(s => s.Id == site.Id)) { context.Sites.Update(site); await context.SaveChangesAsync(); return(true); } return(false); } }
public async Task <bool> UpdateAsync(DbSiteOptions site) { return(await Task.Run(() => { return true; })); }
public Task <DbSiteOptions> CreateAsync(DbSiteOptions site) { throw new NotImplementedException(); }
internal static SiteOptionsDto Map(DbSiteOptions site) { return(new SiteOptionsDto { Id = site.Id, Host = site.Host, PingFrequency = site.PingFrequency }); }