Exemplo n.º 1
0
 public ApplicationModel(Domain.Application.Application application)
 {
     this.Id            = application.Id;
     this.Url           = application.Url;
     this.PathLocal     = application.PathLocal;
     this.DebuggingMode = application.DebuggingMode;
 }
        public async Task <Domain.Application.Application> Get(int id)
        {
            Domain.Application.Application application = await _context.Applications
                                                         .Find(e => e.Id == id)
                                                         .SingleOrDefaultAsync();

            return(Domain.Application.Application.Load(application.Id, application.Url, application.PathLocal, application.DebuggingMode));
        }
        public async Task <Domain.Application.Application> ExecuteGet(int id)
        {
            Domain.Application.Application application = await applicationRepository.Get(id);

            if (application == null)
            {
                throw new ApplicationNotFoundException("There is no application with this id.");
            }

            return(application);
        }
 public async Task Update(Domain.Application.Application application)
 {
     await _context.Applications
     .ReplaceOneAsync(e => e.Id == application.Id, application);
 }
 public async Task Delete(Domain.Application.Application application)
 {
     await _context.Applications.DeleteOneAsync(e => e.Id == application.Id);
 }
 public async Task Add(Domain.Application.Application application)
 {
     await _context.Applications.InsertOneAsync(application);
 }
 public async Task ExecuteDelete(Domain.Application.Application application)
 {
     await applicationRepository.Delete(application);
 }
 public async Task ExecuteAdd(Domain.Application.Application application)
 {
     await applicationRepository.Add(application);
 }