public async Task <CidrGroup> CreateCidrGroup(CidrGroup cidrGroup) { var instance = ef.CidrGroup.FromDomain(cidrGroup); _context.CidrGroup.Add(instance); await _context.SaveChangesAsync(); return(instance.ToDomain()); }
public async Task <CidrGroup> UpdateCidrGroup(CidrGroup cidrGroup) { var instance = await _context.CidrGroup.SingleOrDefaultAsync(x => x.Id == cidrGroup.Id); instance.Name = cidrGroup.Name; instance.CidrList = cidrGroup.CidrList; await _context.SaveChangesAsync(); await _sp.GetService <ProxyService>().ReflashAllProxyServerAllowRules(); return(instance.ToDomain()); }
public Task <CidrGroup> UpdateCidrGroup([FromBody] CidrGroup cidrGroup) { return(_cidrGroupService.UpdateCidrGroup(cidrGroup)); }