public HttpResponseMessage Get([FromUri] int Id, [FromUri] string[] include, [FromUri] bool indent = false)
 {
     try {
         var formatter = new MaxDepthJsonMediaTypeFormatter()
         {
             Indent = indent
         };
         if (include.Length > 0)
         {
             formatter.SerializerSettings.MaxDepth = 100;                     //include.Max<string>(s => s.Split('.').Length * 5);
             formatter.SerializerSettings.PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.Objects;
         }
         else
         {
             formatter.SerializerSettings.MaxDepth = 1;
         }
         TipoColeccionCalendario_Idioma tipocoleccioncalendario_idioma = tipocoleccioncalendario_idiomaRepository.GetById(include, (p => p.Id == Id));
         if (tipocoleccioncalendario_idioma == null)
         {
             throw new HttpResponseException(HttpStatusCode.NotFound);
         }
         return(Request.CreateResponse <TipoColeccionCalendario_Idioma>(HttpStatusCode.OK, tipocoleccioncalendario_idioma, formatter));
     } catch (Exception _excepcion) {
         log.Error(_excepcion);
         return(Request.CreateResponse(HttpStatusCode.InternalServerError, _excepcion));
     }
 }
コード例 #2
0
        public ICommandResult Execute(DeleteTipoColeccionCalendario_IdiomaCommand command)
        {
            var TipoColeccionCalendario_Idioma = TipoColeccionCalendario_IdiomaRepository.GetById(command.Id);

            TipoColeccionCalendario_IdiomaRepository.Delete(TipoColeccionCalendario_Idioma);
            unitOfWork.Commit();
            return(new CommandResult(true));
        }