Ejemplo n.º 1
0
 public static void SeedDatabase(IApplicationBuilder app)
 {
     using (var serviceScope = app.ApplicationServices.CreateScope())
     {
         ICharacterRepositoryAdapter adapter = serviceScope.ServiceProvider.GetService <ICharacterRepositoryAdapter>();
         using (StreamReader r = new StreamReader("briv.json"))
         {
             string          json        = r.ReadToEnd();
             Character       character   = JsonConvert.DeserializeObject <Character>(json);
             DomainCharacter initialChar = CharacterConverter.ToDomain(character);
             adapter.SaveCharacter(initialChar);
         }
     }
 }
 public CharacterService(ICharacterRepositoryAdapter repoAdapter)
 {
     this.repositoryAdapter = repoAdapter;
 }
Ejemplo n.º 3
0
 public DomainCharacterController(ICharacterRepositoryAdapter repositoryAdapter)
 {
     this.repositoryAdapter = repositoryAdapter;
 }