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
// this is a linqpad script | |
// dependencies: bCrypt.Net | |
void Main() | |
{ | |
var id = "DOCID123456789"; | |
var token = GenerateToken(id); | |
var match = DecryptToken(token); | |
Console.WriteLine(match); | |
} |
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 Category(){ | |
public Category(){} | |
// THESE COME FROM LINQ CLASS | |
//public int Id { get; set; } | |
//public string Name { get; set; } | |
} | |
public class CategoryService{ | |
public CategoryService(){} | |
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
(function () { | |
/* | |
* @name ngRightClick | |
* @type Directive | |
* @desc Binds the right click to a javascript function by using the ng-right-click attribute | |
*/ | |
function ngRightClick($parse) { | |
return function (scope, element, attrs) { |
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
// defining an object using JSON (javascript object syntax) | |
var person = { | |
name: 'John', | |
age: 21 | |
}; | |
// Later, if I want to SET a property | |
person.name = 'Mike'; | |
// Or, I might want to GET a property |
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 UtcDateTime | |
{ | |
public UtcDateTime() | |
{ | |
} | |
/// <summary> | |
/// Gets or sets the UTC DateTime. To get a local datetime, use the ToLocal() method. | |
/// </summary> | |
public DateTime DateTime { get; set; } |
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
// Here we inject the specific data provider and logger | |
// We can easlity swap these out for unit testing, and during runtime they can be injected with any DI framework | |
// The important takeaway is that the PatientService defines it's dependencies and they must be injected. | |
// This ensures there are no 'magic' dependencies that we dont know about outside of the constructor. | |
var data = new Core.Data.SqlDataProvider(); | |
var logging = new Core.Services.LoggingService(); | |
var service = new Core.Services.PatientService(dataProvider, logging); | |
// In the Core.Models assembly, we could manipulate objects to our hearts content, having very granular control | |
// The service is our aggregate boundary to the business objects that we allow our application to work with |
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 Junk { | |
public string UnicornName {get; set;} | |
public string UnicornCity {get; set;} | |
public string FoodName {get; set;} | |
} | |
public class Unicorn { | |
public string Name {get;set;} | |
public string City {get;set;} | |
public IList<MagicFood> Food {get; set;} | |
} |
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 BaseViewModel : INotifyPropertyChanged | |
{ | |
#region INotifyPropertyChanged Members | |
public event PropertyChangedEventHandler PropertyChanged; | |
public void NotifyPropertyChanged(string propertyName) | |
{ | |
var handler = this.PropertyChanged; | |
if (handler != null) |
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 IRunner { void Execute(); } | |
// Add any unit tests by implementing IRunner and Linqpad will run it | |
public class UserTest_1 : IRunner | |
{ | |
public void Execute() | |
{ | |
Debug.WriteLine("Beginning test"); | |
var x = 4 + 5; |
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
// Type: System.Drawing.Point | |
// Assembly: System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a | |
// MVID: 197EE30F-EB0D-4311-9EFC-B3622162A2BB | |
// Assembly location: C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Drawing.dll | |
using System; | |
using System.ComponentModel; | |
using System.Globalization; | |
using System.Runtime; | |
using System.Runtime.InteropServices; |
OlderNewer