Exemplo n.º 1
0
        public async Task <DbSiteOptions> CreateAsync(DbSiteOptions site)
        {
            using (var context = new EFContext())
            {
                context.Sites.Add(site);
                await context.SaveChangesAsync();

                return(site);
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
 public async Task <bool> UpdateAsync(DbSiteOptions site)
 {
     return(await Task.Run(() => { return true; }));
 }
Exemplo n.º 4
0
 public Task <DbSiteOptions> CreateAsync(DbSiteOptions site)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 5
0
 internal static SiteOptionsDto Map(DbSiteOptions site)
 {
     return(new SiteOptionsDto {
         Id = site.Id, Host = site.Host, PingFrequency = site.PingFrequency
     });
 }