Exemplo n.º 1
0
 public ServiceResponseModel Create(ServerModel model)
 {
     try
     {
         var(filename, directory) = FileAndDirectoryName(model);
         var isCreated = Files.Create(model.ToJson(), filename, directory);
         return(new ServiceResponseModel
         {
             Message = isCreated ? "Service is created successfully" : "Failed to create",
             Success = isCreated
         });
     }
     catch (Exception ex)
     {
         return(new ServiceResponseModel {
             Message = ex.Message, Success = false
         });
     }
 }