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
using System; | |
using System.Collections.Generic; | |
namespace ClassLibrary3 | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
var service = new PaymentService( |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var stopwatch = new Stopwatch(); | |
stopwatch.Start(); | |
RunParallelly().Wait(); | |
stopwatch.Stop(); |
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 UserStore : | |
UserStore<User, Role, string, UserLogin, UserRole, UserClaim> | |
{ | |
private bool disposed; | |
public UserStore(DbContext context) | |
: base(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
type Result<'a> = | |
| Success of 'a | |
| Failure of string list | |
module Result = | |
let map f xResult = | |
match xResult with | |
| Success x -> |
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
using System; | |
namespace ClassLibrary3 | |
{ | |
public interface IProduct | |
{ | |
} | |
public class Foo : IProduct | |
{ |
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 Exception report | |
message | |
description The server encountered an internal error () that prevented it from fulfilling this request. | |
exception | |
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement | |
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894) |
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 SerializableMultidimensionalArray : IXmlSerializable | |
{ | |
private readonly int[,] array = new int[3, 2]; | |
public int this[int i, int j] | |
{ | |
get | |
{ | |
return this.array[i, j]; | |
} |
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 QueryingFindingEntities | |
{ | |
[Fact] | |
public void FindingEntityByPrimaryKey() | |
{ | |
using (var context = new BlogContext()) | |
{ | |
int execuedCount = 0; | |
context.RegisterCallbackStateChanged(ConnectionState.Open, () => execuedCount++); |
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 IFactory<T> | |
{ | |
T Create(); | |
} | |
public class CacheFactory<T> : IFactory<T> | |
{ | |
private T cached; | |
private readonly object syncLook = new object(); |
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 IPageViewTracker | |
{ | |
IDisposable Track(Page page); | |
} | |
public class NamedPageViewTracker : IPageViewTracker | |
{ | |
public NamedPageViewTracker( | |
IPageViewTracker innerTacker, IPageViewNameProvider provider) | |
{ |
NewerOlder