private async Task RegisterServices() { StorageFolder localFolder = ApplicationData.Current.LocalFolder; var folder = await localFolder.CreateFolderAsync("WarColorsData", CreationCollisionOption.OpenIfExists); container .RegisterHandler(typeof(IDatabase), container => new Database(container.GetInstance <IPlatform>(), folder.Path)); container .PerRequest <IPlatform, MarcelloDB.uwp.Platform>(); }
private void RegisterServices() { string path = Path.Combine( System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "WarColorsData"); if (!System.IO.Directory.Exists(path)) { System.IO.Directory.CreateDirectory(path); } container .RegisterHandler(typeof(IDatabase), container => new Database(container.GetInstance <IPlatform>(), path)); container .PerRequest <IPlatform, MarcelloDB.netfx.Platform>(); }
public T Get() { return(container.GetInstance <T>()); }
/// <summary> /// Gets the instance. /// </summary> /// <typeparam name="T">Type of the instance</typeparam> /// <returns>The instance</returns> public static T GetInstance <T>() => container.GetInstance <T>();