Пример #1
0
        public HttpResponseMessage <long> Delete([FromUri] IEnumerable <long> id)
        {
            if (id == null)
            {
                throw new WebArgumentException("No id was specified");
            }

            long[] ids  = id as long[] ?? id.ToArray( );
            var    refs = ids.Distinct().Select(i => new EntityRef(i));

            EventLog.Application.WriteInformation(string.Format("webapi- deleting {0} entities", ids.Length));

#pragma warning disable 618
            var svc = new EntityInfoService();
#pragma warning restore 618
            svc.DeleteEntities(refs);

            EventLog.Application.WriteInformation(string.Format("webapi- deleting complete"));

            return(new HttpResponseMessage <long>(HttpStatusCode.OK));
        }