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
[main] Building folder: PROJECT | |
[build] Starting build | |
[proc] Executing command: /usr/local/bin/cmake --build /home/username/source/REPO/build --config Debug --target all -- | |
[build] [1/6 16% :: 0.390] Performing update step for 'azure-ctest' | |
[build] HEAD is now at 5b9bcbf Build with VS2022 (#112) | |
[build] [2/6 33% :: 0.398] No patch step for 'azure-ctest' | |
[build] [3/6 50% :: 0.452] Performing configure step for 'azure-ctest' | |
[build] -- target architecture: x86_64 | |
[build] -- Configuring done | |
[build] -- Generating done |
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 HttpClientRequestMessage : DataServiceClientRequestMessage | |
{ | |
private HttpRequestMessage requestMessage; | |
private readonly HttpClient client; | |
private readonly HttpClientHandler handler; | |
private readonly MemoryStream messageStream; | |
private readonly Dictionary<string, string> contentHeaderValueCache; | |
private readonly RetryPolicy<HttpResponseMessage> pollyPolicy; | |
public HttpClientRequestMessage(string actualMethod, RetryPolicy<HttpResponseMessage> pollyPolicy) |
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
Description=My Node app which runs on restart. | |
Wants=network.target | |
After=syslog.target network-online.target | |
[Service] | |
Type=simple | |
ExecStart=/usr/bin/node /etc/node-app/index.js | |
Restart=on-failure | |
RestartSec=10 |
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 CustomSerializerProvider : DefaultODataSerializerProvider | |
{ | |
public CustomSerializerProvider(IServiceProvider rootContainer) | |
: base(rootContainer) | |
{ | |
} | |
public override ODataEdmTypeSerializer GetEdmTypeSerializer(IEdmTypeReference edmType) | |
{ | |
if (edmType.IsCollection() && edmType.AsCollection().ElementType().IsEntity()) | |
{ |
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
Console.WriteLine(new DateTimeOffset(new DateTime(2019, 11, 3, 0, 30, 0))); | |
Console.WriteLine(new DateTimeOffset(new DateTime(2019, 11, 3, 1, 30, 0))); | |
//> 11/3/2019 12:30:00 AM -05:00 | |
//> 11/3/2019 1:30:00 AM -06:00 | |
Console.WriteLine(new DateTimeOffset(new DateTime(2019, 3, 10, 0, 30, 0))); | |
Console.WriteLine(new DateTimeOffset(new DateTime(2019, 3, 10, 3, 30, 0))); | |
//> 3/10/2019 12:30:00 AM -06:00 |
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
void Main() | |
{ | |
var p = new Person { FirstName = "Bill", LastName= "Gates", MiddleName = string.Empty, Age = 62}; | |
Console.WriteLine(Extensions.GetName(() => p.FirstName)); | |
Console.WriteLine(Extensions.GetName(() => p.LastName)); | |
Console.WriteLine(Extensions.GetName(() => p.Age)); | |
Console.WriteLine(Extensions.GetName(() => p.Birthdate)); | |
Console.WriteLine(Extensions.GetName(() => p.Parents)); |
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 string GetName<T>(this Expression<Func<T>> action) | |
{ | |
return GetNameFromMemberExpression(action.Body); | |
} | |
static string GetNameFromMemberExpression(Expression expression) { | |
if (expression is MemberExpression) { | |
return (expression as MemberExpression).Member.Name; | |
} | |
else if (expression is UnaryExpression) { |
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
protected JsonResult RemoteJsonResponseForProperty(string property = null) | |
{ | |
object response; | |
if (string.IsNullOrWhiteSpace(property)) | |
{ | |
property = System.Web.HttpContext.Current.Request.QueryString.Keys[0]; | |
} | |
if (ModelState.ContainsKey(property) && ModelState[property].Errors.Any()) |
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
[RemoteModelValidator(typeof(MyModel), "ValidateModelFields", "MyController")] | |
public string State { 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 RemoteModelValidatorAttribute : RemoteAttribute | |
{ | |
public RemoteModelValidatorAttribute(Type modelType, string action, string controller) :base(action, controller) | |
{ | |
AdditionalFields = string.Join(",", modelType.GetProperties(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance).Select(p => p.Name)); | |
} | |
} |
NewerOlder