Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Application factory  = new TextApplication();
            Document    document = factory.CreateDocument();

            var factory2  = new ImageApplication();
            var document2 = factory2.CreateDocument();

            var factory3 = new DocumentFactory("Text");

            var textDocument = factory3.CreateDocument();
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <ImageApplication> > Put(
            [FromBody] ImageApplication model)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

                var result = await _imageService.UpdateAsync(model);

                return(Created("", result));
            }
            catch (Exception ex)
            {
                return(Conflict(ex.Message));

                throw;
            }
        }
Ejemplo n.º 3
0
        public async Task <ImageApplication> UpdateAsync(ImageApplication entity)
        {
            var result = await _imageRepository.UpdateAsync(ImageMapper.Map(entity));

            return(ImageMapper.Map(result));
        }