standards-c-sharp

Web solution structure

This describes the standard abstract solution structure preferred by Agoda for a web-based project. Each box represents one project in the solution. Use common sense and adapt to your specific use-case.

Web solution structure

Presentation project(s)

View models / DTOs

Views

Controllers

Presentational helpers

Service project

Should be hosting environment agnostic - ie. should not depend on any HTTP abstractions.

Services

Helpers

Models

Models are meant to be reusable, their properties should not be tightly coupled with presentational needs and/or experimentation.

Repos

Folder structure

For example:

+- (Project root)
  +- Geography
    +- Models
      City
      Country
      Landmark
    +- Repositories
      GeoRepository
      IGeoRepository
  +- Pricing
    +- Models
      RoomPrice
    +- Repositories
      PriceRepository
      IPriceRepository
  +- Users
    +- Models
      BaseUser
      Traveller
      Host
    +- Repositories
      UserRepository
      IUserRepository
  +- Localization
    PriceFormatter
    DateFormatter
    +- Models
      Currency
      Language
    +- Repository
      CurrencyRepository
      ICurrencyRepository
      LanguageRepository
      ILanguageRepository