コード例 #1
0
        public ParentsViewModel()
        {
            deleteCommand = new DeleteParentCommand(this);
            updateCommand = new UpdateParentCommand(this);
            addCommand    = new AddParentCommand(this);
            //saveCommand = new SaveCommand(this);

            parentsList = new ObservableCollection <ParentModel>
            {
                ////new ParentModel{IDParent = "1",FirstName = "Joe", LastName = "Doe"},
                ////new ParentModel{IDParent = "2",FirstName = "Jof", LastName = "Boe"}
            };
            DataGrid_Loaded();
        }
コード例 #2
0
        public async Task <IActionResult> Add([FromBody] AddParentCommand command)
        {
            Parent parent = await mediator.Send(command);

            var result = new
            {
                ParentId       = parent.Id,
                Name           = parent.GetName().Text,
                Identification = parent.GetIdentification().Text,
                BirthDate      = parent.GetBirthDate()
            };

            return(CreatedAtRoute("GetParent", new { id = parent.Id }, result));
        }
コード例 #3
0
 public async Task <IActionResult> AddParent(AddParentCommand command)
 {
     return(Ok(await mediator.Send(command)));
 }