private static ApplicationResponse ToResponse(ApplicationDocument application) { return (new ApplicationResponse { Id = application.Id, Name = application.Name, Version = Environment.GetEnvironmentVariable("APP_VERSION"), Host = Environment.MachineName }); }
public async Task <ApplicationResponse> Post([FromBody] CreateApplicationRequest request) { var application = new ApplicationDocument { Id = Guid.NewGuid().ToString("N"), Name = request.Name }; await this.applications.InsertOneAsync(application); return(ToResponse(application)); }