示例#1
0
        public async Task <SimpleResult> DeleteSites(DeleteSitesInput input)
        {
            try
            {
                foreach (var id in input.Ids)
                {
                    var siteId = Convert.ToInt64(id);
                    var site   = await _context.Sites.FindAsync(siteId);

                    site.Deleted = true;
                    _context.Entry(site).State = EntityState.Modified;
                }
                await _context.SaveChangesAsync();

                return(new SimpleResult
                {
                    IsSuccess = true
                });
            }
            catch
            {
                return(new SimpleResult
                {
                    IsSuccess = false
                });
            }
        }
示例#2
0
        public async Task <JsonResult> DeleteSites([FromBody] DeleteSitesInput input)
        {
            var result = await _site.DeleteSites(input);

            return(await GenerateResult(result, _userSettings));
        }