Exemplo n.º 1
0
 public static Server ToDataModel(this ServerOnlyVm server)
 {
     return(new Server()
     {
         Name = server.Name,
         Address = server.Address,
         OperatingSystem = server.OperatingSystem
     });
 }
Exemplo n.º 2
0
        public R.ResultVm <bool> AddServer(ServerOnlyVm server)
        {
            var rv = new ResultVm <bool>().FromEmptyFailure();

            Demand <string> .That(server.Name, "server.Name").HasNonEmptyValue().Result(rv);

            if (rv.Errors.Count == 0)
            {
                try
                {
                    return(new ResultVm <bool>().FromSuccessObject(_repo.AddServer(server.ToDataModel())));
                }
                catch (Exception ex)
                {
                    return(new ResultVm <bool>().FromException(ex));
                }
            }
            else
            {
                return(rv);
            }
        }
Exemplo n.º 3
0
 public ResultVm <bool> AddServer(ServerOnlyVm server)
 {
     return(null);
 }