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
| [Migration(2)] | |
| public class AddUrlToUserTable : Migration | |
| { | |
| public override void Up() | |
| { | |
| Alter.Table("myusertable") | |
| .AddColumn("url").AsString(150).Nullable(); | |
| } | |
| public override void Down() |
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
| [Migration(1)] | |
| public class CreateUserTable : Migration | |
| { | |
| public override void Up() | |
| { | |
| Create.Table("myusertable") | |
| .WithColumn("id").AsInt32().NotNullable().PrimaryKey().Identity() | |
| .WithColumn("name").AsString(100).NotNullable() | |
| .WithColumn("birthdate").AsDateTime().NotNullable() | |
| .WithColumn("address").AsString(100).NotNullable() |
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 override void OnInvoke(MethodInterceptionArgs args) | |
| { | |
| try | |
| { | |
| args.Proceed(); | |
| } | |
| catch (SqlException ex) | |
| { | |
| ex.ToExceptionless().Submit(); | |
| var obj = (ServiceBase) args.Instance; |
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 override void OnInvoke(MethodInterceptionArgs args) | |
| { | |
| try | |
| { | |
| args.Proceed(); | |
| } | |
| catch (SqlException ex) | |
| { | |
| ex.ToExceptionless().Submit(); | |
| var obj = (ServiceBase) args.Instance; |
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 override void OnInvoke(MethodInterceptionArgs args) | |
| { | |
| try | |
| { | |
| args.Proceed(); | |
| } | |
| catch (Exception ex) | |
| { | |
| ex.ToExceptionless().Submit(); | |
| var obj = (ServiceBase)args.Instance; |
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 override bool CompileTimeValidate(MethodBase method) | |
| { | |
| if (!typeof (ServiceBase).IsAssignableFrom(method.DeclaringType)) | |
| { | |
| Message.Write(method, SeverityType.Error, "SEI01", "The target type (" + method.DeclaringType.FullName + ") does not implement ServiceBase."); | |
| return false; | |
| } | |
| return base.CompileTimeValidate(method); | |
| } |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>Matthew D. Groves</title> | |
| <link href="Content/style.css" rel="stylesheet"> | |
| </head> |
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 override void OnInvoke(MethodInterceptionArgs args) | |
| { | |
| try | |
| { | |
| args.Proceed(); | |
| } | |
| catch (SqlException ex) | |
| { | |
| var service = args.Instance as ServiceBase; | |
| if(service != null) |
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 abstract class ServiceBase | |
| { | |
| public Action<string> AddValidationError { get; set; } | |
| } | |
| public class TerritoryService : ServiceBase, ITerritoryService | |
| { | |
| public int DoSomething(int id) | |
| { | |
| // do something |
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 override void OnInvoke(MethodInterceptionArgs args) | |
| { | |
| try | |
| { | |
| args.Proceed(); | |
| } | |
| catch (SqlException ex) | |
| { | |
| var terrService = args.Instance as ITerritoryService; | |
| if(terrService != null) |