﻿using System.Threading.Tasks;
using JumbleRef.Core.Models.Data;
using Microsoft.EntityFrameworkCore;

namespace JumbleRef.Core.Services
{
    public interface IDataService
    {
        Task InitializeDataStorageAsync();
    }

    public sealed class DataService : IDataService, IService
    {
        public async Task InitializeDataStorageAsync()
        {
            using (var context = new JumbleRefDataContext())
            {
                await context.Database.MigrateAsync();
            }
        }
    }
}
