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.Reflection | |
@using System.Linq.Expressions; | |
@using System.ComponentModel | |
@using System.ComponentModel.DataAnnotations | |
@typeparam T | |
<label for="@control">@label</label> | |
@code { |
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
### Keybase proof | |
I hereby claim: | |
* I am mxmissile on github. | |
* I am mxmissile (https://keybase.io/mxmissile) on keybase. | |
* I have a public key ASBeoE5HDu-ITNl49iz5DepOizRs-oKeuUv27V18Ypq1ygo | |
To claim this, I am signing this 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 void mappingtest() | |
{ | |
var config = new MapperConfiguration(cfg => | |
{ | |
cfg.CreateMap<Asset, AssetDetailsDTO>() | |
.ForMember(dto => dto.RequestId, conf => conf.MapFrom(x => x.Request.UUID)); | |
}); | |
var mapper = config.CreateMapper(); | |
var guid = Guid.NewGuid(); |
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.2ae54a5bcaf9cea1014f.bundle.js:1 ERROR TypeError: Cannot read property 'src' of null | |
at Object.submit (zuora.min.js:31) | |
at n.submit (main.2ae54a5bcaf9cea1014f.bundle.js:1) | |
at n.startZuora (main.2ae54a5bcaf9cea1014f.bundle.js:1) | |
at n.process (main.2ae54a5bcaf9cea1014f.bundle.js:1) | |
at e._next (main.2ae54a5bcaf9cea1014f.bundle.js:1) | |
at e.__tryOrSetError (main.2ae54a5bcaf9cea1014f.bundle.js:1) | |
at e.next (main.2ae54a5bcaf9cea1014f.bundle.js:1) | |
at e._next (main.2ae54a5bcaf9cea1014f.bundle.js:1) | |
at e.next (main.2ae54a5bcaf9cea1014f.bundle.js:1) |
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 CommandNameHandler : IRequestHandler<source, destination> | |
{ | |
public CommandNameHandler(IDb db) | |
{ | |
_db = db; | |
} | |
private IDb _db; | |
// constructors and privates |
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 d = new Dictionary<string, object>(); | |
d.Add("RefId", 1); | |
var types = new List<string>(); | |
types.Add("fruit"); | |
types.Add("veg"); | |
types.Add("fung"); | |
var foodList = session.QueryOver<Food>() | |
.Where(NHibernate.Criterion.Restrictions.AllEq(d) && NHibernate.Criterion.Restrictions.In("Type", types)); |
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 PostalAddressMap | |
: ClassMap<PostalAddress> | |
{ | |
public PostalAddressMap() | |
{ | |
Table("tblPostalAddresses"); | |
Id(x => x.Id); | |
Map(x => x.Address); | |
Map(x => x.AddressType); | |
Map(x => x.Owner); |
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 addresses = new[] {new PostalAddress(), new PostalAddress()}; | |
var spec = new PersistenceSpecification<Contact>(session); | |
spec.CheckProperty(p => p.Name, "something") | |
.CheckProperty(p => p.GivenName, "something else") | |
.CheckInverseList(l => l.Addresses, addresses) | |
etc etc | |
.VerifyTheMappings(); |
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
<rule name="Redirect to HTTPS" stopProcessing="true"> | |
<match url="(.*)" /> | |
<conditions logicalGrouping="MatchAll" trackAllCaptures="false"> | |
<add input="{HTTPS}" pattern="^OFF$" /> | |
</conditions> | |
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" /> | |
</rule> | |
courtesy of Sides of March | |
http://www.sidesofmarch.com/index.php/archive/2014/09/02/forcing-iis-to-rewrite-all-requests-to-https/ |
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 HtmlTag LabelWithInput<T>(this HtmlHelper<T> helper, Expression<Func<T, object>> expression) where T : class | |
{ | |
var generator = GetGenerator<T>(); | |
var label = generator.LabelFor(expression, model: helper.ViewData.Model); | |
var input = generator.InputFor(expression, model: helper.ViewData.Model); | |
var div = new DivTag(); | |
div.AddClass("form-group"); | |
div.Append(label); | |
div.Append(input); |