Exemple #1
0
        public static GroupViewModel ToViewModel(this Group model)
        {
            var viewModel = new GroupViewModel();
            viewModel.InjectFrom(model);

            return viewModel;
        }
Exemple #2
0
        public ActionResult AddGroup(GroupViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                var model = viewModel.ToModel();
                this._groupManager.Add(model, this.GetInstitutionID);

                return this.Json(new { success = true });
            }
            return this.Json(new {success = false});
        }