Search Results

Search found 5 results on 1 pages for 'jaklucky'.

Page 1/1 | 1 

  • License Check before executing

    - by jaklucky
    Hi, We have an application (written in C# on .NET Framework 3.5) that is licensed using our custom licensing mechanism. In the current implementation, in each method we first check for if the machine has valid license or not. To me, it is little bit awkward. Is there any way to let the runtime check for the license before creating the object or excuting a method? Will writing a custom attribute solves this problem? Any ideas or solutions are greatly appreciated. Thank you, Suresh

    Read the article

  • Custom code access permissions

    - by jaklucky
    Hi all, We have a server written in C# (Framework 3.5 SP1). Customers write client applications using our server API. Recently, we created several levels of license schemes like Basic, Intermediate and All. If you have Basic license then you can call few methods on our API. Similiarly if you have Intermediate you get some extra methods to call and if you have All then you can call all the methods. When server starts it gets the license type. Now in each method I have to check the type of license and decide whether to proceed further with the fucntion or return. For example, a method "InterMediateMethod()" can only be used by Intermediate License and All license. So I have to something like this. public void InterMediateMethod() { if(licenseType == "Basic") { throw new Exception("Access denined"); } } It looks like to me that it is very lame approach. Is there any better way to do this? Is there any declarative way to do this by defining some custom attributes? I looked at creating a custom "CodeAccessSecurityAttribute" but did not get a good success. Thank you, Suresh

    Read the article

  • ObjectContext disposed puzzle

    - by jaklucky
    Hi, I have the follwing method. public List<MyEntity> GetMyEntities(MyObjectContext objCtx) { using(MyObjectContext ctx = objCtx ?? new MyObjectContext()) { retun ctx.MyEntities.ToList(); } } The idea is, user of this method can pass in the objectcontext if they have. If not then a new objectcontext will be created. If I am passing an object context to it, then it is getting disposed after the method is done. I was expecting only "ctx" variable gets disposed. If I write a small app, to know the using and dispose mechanism. It is acting differently. class TestClass : IDisposable { public int Number { get; set; } public string Str { get; set; } public ChildClass Child { get; set; } #region IDisposable Members public void Dispose() { Console.WriteLine("Disposed is called"); } #endregion } class ChildClass : IDisposable { public string StrChild { get; set; } #region IDisposable Members public void Dispose() { Console.WriteLine("Child Disposed is called"); } #endregion } class Program { static void Main(string[] args) { TestClass test = null; test = new TestClass(); test.Child = new ChildClass(); using (TestClass test1 = test ?? new TestClass()) { test1.Number = 1; test1.Str = "hi"; test1.Child.StrChild = "Child one"; test1.Child.Dispose(); } test.Str = "hi"; test.Child.StrChild = "hi child"; Console.ReadLine(); } } In this example, "test1"gets disposed but not "test". Where as in the first case both ctx and objCtx get disposed. Any ideas what is happening here with objectContext? Thank you, Suresh

    Read the article

  • Triggers in Entity Framework - Need advice

    - by jaklucky
    Hi all, I am new to Entity Framework and please pardon my ignorance. We have a simple application written using SQL Server and ADO.Net. Now we have got a new requirement that, whenever a particular rows get updated by our application, some business logic has to happen. I have been looking into Triggers in SQL server and it looks like we can do it using triggers. I am also looking at Entity Framework's OnPropertyChange capability. Is it possible to do it with "OnPropertyChange"? I mean, Can I create a model and implement "OnPropertyChange" method? And when our application modifies the rows using ADO.Net, then will it fire "OnPropertyChange" event so that my custome code in "OnPropertyChange" excutes? Thank you in advance for your inputs, Suresh

    Read the article

  • Service Contracts with Message causes duplicate proxy classes

    - by jaklucky
    Hi, I have a service contract with Message as shown below. [OperationContract] Message MyMethodWithMessage(Message myMsgParam); Everything works fine. I could host my services. But when I try to create proxies through "Add Service References", I am getting the duplicate proxy classes. If I take out the above OperationContract and re run my services and try to create proxies, then "Add Service References" does not provide duplicate proxies. I am really confused about this!!! Any help is greatly appreciated... Thank you, Suresh

    Read the article

1