This file contains hidden or 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) | |
{ | |
ActiveRecordStarter.ResetInitializationFlag(); | |
IConfigurationSource source = new XmlConfigurationSource("appconfig.xml"); | |
ActiveRecordStarter.Initialize(Assembly.GetAssembly(typeof(CastleActiveRecordSample.Person)), source); | |
ActiveRecordStarter.DropSchema(); |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8" ?> | |
<activerecord> | |
<config> | |
<add | |
key="connection.driver_class" | |
value="NHibernate.Driver.SqlClientDriver" /> | |
<add | |
key="dialect" |
This file contains hidden or 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
[HttpPost] | |
public ActionResult Write(PostInputViewModel input) | |
{ | |
//bool val = TryValidateModel(input); | |
if (!ModelState.IsValid) | |
return View("Write", input); | |
var post = new Post | |
{ |
This file contains hidden or 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 Teacher | |
{ | |
public string Name { get; set; } | |
public string Age { get; set; } | |
public Teacher SearchTeacher(teacher t) | |
{ | |
// TODO | |
// 실제 디비를 조회해서 해당 결과를 Teacher 타입으로 리턴하는 로직. | |
return new Teacher(); |
This file contains hidden or 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
Show hidden characters
{ | |
"files": | |
{ | |
"bootstrap-responsive.min.css": "https://raw.github.com/gist/4110291/2269019f1891b9da9dea682e94807832bef84e55/bootstrap-responsive.min.css", | |
"bootstrap.min.css": "https://raw.github.com/gist/4110295/43e16d7251131cf2f5027053316be968c25f89d0/bootstrap.min.css", | |
"bootstrap.min.js": "https://raw.github.com/twitter/bootstrap/master/docs/assets/js/bootstrap.min.js", | |
"css3-mediaqueries.min.js": "https://raw.github.com/gist/4142494/eda83cdf8c521de31e5f71858568d8f2ada9c1f1/css3-mediaqueries.min.js", | |
"jquery-ui.css": "http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css", | |
"jquery-ui.js": "http://code.jquery.com/ui/1.9.1/jquery-ui.js", | |
"jquery.fitvids.min.js": "https://raw.github.com/gist/4173802/8766aa93630b1a94b94094347a88cabe673c0869/jquery.fitvids.min.js", |
This file contains hidden or 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
/* | |
* Helper mixins | |
*/ | |
#gradient { | |
.horizontal(@startColor : #555, @endColor : #333) { | |
background-color : @endColor; | |
background-image : -moz-linear-gradient(left, @startColor, @endColor); // FF 3.6+ | |
background-image : -webkit-gradient(linear, 0 0, 100% 0, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+ | |
background-image : -webkit-linear-gradient(left, @startColor, @endColor); // Safari 5.1+, Chrome 10+ |
This file contains hidden or 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 class JsonCamelCaseConfig | |
{ | |
public static void RegisterConfig(HttpConfiguration config) | |
{ | |
var json = config.Formatters.JsonFormatter; | |
json.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); | |
} | |
} |
This file contains hidden or 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 JsonConfig | |
{ | |
public static void RegisterConfig(HttpConfiguration config) | |
{ | |
var json = config.Formatters.JsonFormatter; | |
json.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; | |
} | |
} |
This file contains hidden or 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 FilterConfig | |
{ | |
public static void RegisterConfig(HttpConfiguration config) | |
{ | |
// register global model validation filter | |
config.Services.RemoveAll(typeof(System.Web.Http.Validation.ModelValidatorProvider), v => v is System.Web.Http.Validation.Providers.InvalidModelValidatorProvider); | |
config.Filters.Add(new ValidationActionFilter()); | |
} | |
} |
This file contains hidden or 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 BlogContext : DbContext | |
{ | |
public BlogContext() | |
{ | |
} | |
public DbSet<Post> Posts { get; set; } | |
public DbSet<Tag> Tags { get; set; } | |
protected override void OnModelCreating(DbModelBuilder modelBuilder) |
OlderNewer