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
var transportOrder = _appService.FindById<TransportOrder>(transportOrderId); | |
transportOrder.ReceiveLoadGuid = closedLoadId; | |
Save(transportOrder); | |
if (transportOrder == null) | |
{ | |
throw new ArgumentNullException("transportOrderId"); | |
} |
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
ret.Add(string.Format(Error.TransportOrderAlreadyExists + string.Empty, transportOrder.LoadNumber)); |
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 Searcher | |
{ | |
public void Search(string searchTerm = null) | |
{ | |
// .Where(r => searchTerm == null || r.Name.Contains(searchTerm)) | |
} | |
} | |
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
var errorInModelState = this.ModelState.Keys.SelectMany(key => this.ModelState[key].Errors).Select(k => k.ErrorMessage); | |
return Request.CreateResponse(HttpStatusCode.BadRequest, errorInModelState); |
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
((ObjectQuery<OpenGoodsReceiptFilteredTransporters>)query).ToTraceString(); |
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.ComponentModel.DataAnnotations; | |
namespace MocheRandomGeneration.Core.Utilities.ValidationAttributes | |
{ | |
[AttributeUsage(AttributeTargets.Property)] | |
public sealed class EmailAttribute : RegularExpressionAttribute | |
{ | |
public EmailAttribute() : base(@"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}") | |
{ |
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; | |
using System.Data.SqlClient; | |
using System.Reflection; | |
using System.Text.RegularExpressions; | |
namespace Utilities.Database | |
{ | |
/// <summary> | |
/// Converts exceptions thrown by the DB into the correct exception |
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 void Update(Entity currentEntity) | |
{ | |
using(var db = new Context()) | |
{ | |
db.DbSet.Attach(currentEntity); | |
db.Entry(currentEntity).State = EntityState.Modified; | |
// V4 | |
////context.ObjectStateManager.ChangeObjectState(currentEntity, EntityState.Modified); | |
db.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
var mobilePhonePt = new Regex(@"^9(1|2|3|6)\d{7}$"); | |
var email = new Regex(@"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}"); |
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
Update-Package [PackageId] -Reinstall |
NewerOlder