Example #1
0
    public static AomMetaViewModel MapDbModelToViewModel(AomMeta dbModel)
    {
        var viewModel = new  AomMetaViewModel();

        viewModel.ID   = dbModel.ID;
        viewModel.Name = dbModel.Name;
        return(viewModel);
    }
Example #2
0
    public static AomMeta MapInsertModelToDbModel(AomMetaViewModel model, AomMeta newDomainModel = null)
    {
        if (newDomainModel == null)
        {
            newDomainModel = new AomMeta();
        }

        newDomainModel.ID   = model.ID;
        newDomainModel.Name = model.Name;

        return(newDomainModel);
    }
Example #3
0
        public void Insert()
        {
            // Arrange - Create a new account view model
            var newAomMetaViewModel = new AomMetaViewModel()
            {
                Name = "New Aom Meta Name"
            };


            // Act - send this to the insert method on the account service logic
            var Response = _AomMetaService.Insert(newAomMetaViewModel, mockUser);


            // Assert
            Assert.IsTrue(Response.Success);
        }
    // PUT: api/AomMeta/5
    public Response <AomMetaViewModel> Put(int id, AomMetaViewModel model)
    {
        Response <AomMetaViewModel> result = AomMetaService.Insert(model, null);

        return(result);
    }