File Maintenance: Difference between revisions

From Bitnami MediaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
<strong># Create the entity class in the Novus.Model.Entity project.
# Create the entity class in the Novus.Model.Entity project.
a. Optionally, implement the audit fields as described in the Database section.
## Optionally, implement the audit fields as described in the Database section.
b. Optionally, implement the version field as described in the Optimistic Concurrency Control section.
## Optionally, implement the version field as described in the Optimistic Concurrency Control section.
2. Create the corresponding DTO in Novus.Model.DTO project. Make sure to copy all the properties (including the navigational properties / dependent collections) of the entity to the DTO or AutoMapper will not work for that entity.
# Create the corresponding DTO in Novus.Model.DTO project. Make sure to copy all the properties (including the navigational properties / dependent collections) of the entity to the DTO or AutoMapper will not work for that entity.
3. If the entity has a navigational property, and the DTO doesn't, create a AutoMapper profile in Novus.Model.Mapper project:
# If the entity has a navigational property, and the DTO doesn't, create a AutoMapper profile in Novus.Model.Mapper project:
public class FooProfile : Profile, IProfile
<pre>public class FooProfile : Profile, IProfile
{
{
   public FooProfile()
   public FooProfile()
Line 11: Line 11:
       .ForMember(dest => dest.NavigationalProperty, opt => opt.Ignore());
       .ForMember(dest => dest.NavigationalProperty, opt => opt.Ignore());
   }
   }
}
}</pre>
4. Add a property to get the repository for the entity in the IUnitOfWork interface and implementation in the Novus.DataAccess project. The unit of work is not a good abstraction to use since the underlying DbContext is already a unit of work itself.
 
5. Create the service interface in Novus.Business project in the Interfaces directory.
#<li value="4"> Add a property to get the repository for the entity in the IUnitOfWork interface and implementation in the Novus.DataAccess project. The unit of work is not a good abstraction to use since the underlying DbContext is already a unit of work itself.</li>
6. Create the service implementation directly under Novus.Business.
# Create the service interface in Novus.Business project in the Interfaces directory.
7. Create the controller.
# Create the service implementation directly under Novus.Business.
8. Create the TypeScript class  that has the same properties as the DTO.
# Create the controller.
9. Create the SFC.
# Create the TypeScript class  that has the same properties as the DTO.
# Create the SFC.






Return to [[Programming Guide]]
Return to [[Programming Guide]]

Latest revision as of 15:21, 10 October 2023

  1. Create the entity class in the Novus.Model.Entity project.
    1. Optionally, implement the audit fields as described in the Database section.
    2. Optionally, implement the version field as described in the Optimistic Concurrency Control section.
  2. Create the corresponding DTO in Novus.Model.DTO project. Make sure to copy all the properties (including the navigational properties / dependent collections) of the entity to the DTO or AutoMapper will not work for that entity.
  3. If the entity has a navigational property, and the DTO doesn't, create a AutoMapper profile in Novus.Model.Mapper project:
public class FooProfile : Profile, IProfile
{
  public FooProfile()
  {
    CreateMap<FooDTO, Foo>()
      .ForMember(dest => dest.NavigationalProperty, opt => opt.Ignore());
  }
}
  1. Add a property to get the repository for the entity in the IUnitOfWork interface and implementation in the Novus.DataAccess project. The unit of work is not a good abstraction to use since the underlying DbContext is already a unit of work itself.
  2. Create the service interface in Novus.Business project in the Interfaces directory.
  3. Create the service implementation directly under Novus.Business.
  4. Create the controller.
  5. Create the TypeScript class that has the same properties as the DTO.
  6. Create the SFC.


Return to Programming Guide