This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IDataProtectionProvider provider = app.GetDataProtectionProvider(); | |
if (provider != null) | |
{ | |
userManager.UserTokenProvider = new DataProtectorTokenProvider<IdentityUser, Guid>(provider.Create("User Tokens")); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
userManager.UserTokenProvider = new EmailTokenProvider<IdentityUser, Guid>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class HelpPageConfig | |
{ | |
public static void Register(HttpConfiguration config) | |
{ | |
var path = HostingEnvironment.MapPath("~/App_Data/XmlDocument.xml"); | |
if (!string.IsNullOrWhiteSpace(path)) | |
{ | |
config.SetDocumentationProvider( | |
new XmlDocumentationProvider(path)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Interface for the unit of work pattern, inherits from IDisposable to dispose of the DbContext | |
/// </summary> | |
public interface IUnitOfWork: IDisposable | |
{ | |
/// <summary> | |
/// Saves the changes of the DbContext wrapped by the UoW | |
/// </summary> | |
/// <returns></returns> | |
int SaveChanges(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EntityRepository<T> : IRepository<T> | |
where T : class | |
{ | |
protected DbContext Context = null; | |
public EntityRepository(DbContext context) | |
{ | |
if (context == null) throw new ArgumentNullException("context"); | |
Context = context; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IRepository<T> where T : class | |
{ | |
/// <summary> | |
/// Gets all objects from database | |
/// </summary> | |
IQueryable<T> All(params string[] includes); | |
/// <summary> | |
/// Gets objects from database by filter. | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class CameraView : PhoneApplicationPage | |
{ | |
private PhotoCamera cam; | |
public CameraView() | |
{ | |
InitializeComponent(); | |
activateCamera(); | |
} | |
private void activateCamera() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Grid x:Name="LayoutRoot" VerticalAlignment="Stretch"> | |
<Canvas x:Name="viewfinderCanvas"> | |
<Canvas.Background> | |
<VideoBrush x:Name="viewfinderBrush"> | |
<VideoBrush.RelativeTransform> | |
<CompositeTransform x:Name="previewTransform" CenterX=".5" CenterY=".5" /> | |
</VideoBrush.RelativeTransform> | |
</VideoBrush> | |
</Canvas.Background> | |
</Canvas> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IRepository<T> where T : class | |
{ | |
/// <summary> | |
/// Gets all objects from database | |
/// </summary> | |
IQueryable<T> All(); | |
/// <summary> | |
/// Gets objects from database by filter. | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpHeader("Access-Control-Allow-Origin", "*")] | |
public class UserController : ApiController | |
{ | |
public IEnumerable<string> Get() | |
{ | |
return new List<string> { "User1", "User2" }; | |
} | |
} |