Skip to content

The Intwenty DataService

Johan Filipsson edited this page Feb 11, 2021 · 11 revisions

The Intwenty DataService

The Intwenty.DataService is one of the core components of Intwenty. It handles all data I/O for Intwenty Applications. By using the service it's guaranteed that your application can be persisted / retrieved the same way regardless of which supported database you're using.

The Intwenty.DataService implements IIntwentyDataService and you use it by injecting it into the class / controller where you need it.

Example

  public class MyIntwentyController : Controller
  {

         private readonly IIntwentyModelService _modelservice;
         private readonly IIntwentyDataService _dataservice;
         private readonly IntwentySettings _settings;

         public MyIntwentyController(IIntwentyModelService modelservice, 
                                     IIntwentyDataService dataservice, 
                                     IOptions<IntwentySettings> settings)
         {
             _modelservice = modelservice;
             _dataservice = dataservice;
             _settings = settings.Value;
         }