Search Results

Search found 4 results on 1 pages for 'oillio'.

Page 1/1 | 1 

  • Writing scripts for Visual Studio project

    - by oillio
    What is the best way to write and run small scripts and tasks that are specific to a particular .Net project? Such things as configuring a database or confirming proper connections to servers. In Ruby, I would build rake tasks for this sort of thing. I am currently using unit tests for these tasks as they are easy to run within VS and they have access to all the necessary libraries and project code. However, this is not really their intended purpose and, with the dropping of Test Lists in VS 2012, it does not work nearly as well as it used to. Is there a better solution than writing a console project to handle these little code snippets I need to run periodically?

    Read the article

  • Is this ISession handled by the SessionScope - Castle ActiveRecord

    - by oillio
    Can I do this? I have the following in my code: public class ARClass : ActiveRecordBase<ARClass> { ---SNIP--- public void DoStuff() { using (new SessionScope()) { holder.CreateSession(typeof(ARClass)).Lock(this, LockMode.None); ...Do some work... } } } So, as I'm sure you can guess, I am doing this so that I can access lazy loaded references in the object. It works great, however I am worried about creating an ISession like this and just dropping it. Does it get properly registered with the SessionScope and will the scope properly tare my ISession down when it is disposed of? Or do I need to do more to manage it myself?

    Read the article

  • using STI and ActiveRecordBase<> with full FindAll

    - by oillio
    Is it possible to use generic support with single table inheritance, and still be able to FindAll of the base class? As a bonus question, will I be able to use ActiveRecordLinqBase< as well? I do love those queries. More detail: Say I have the following classes defined: public interface ICompany { int ID { get; set; } string Name { get; set; } } [ActiveRecord("companies", DiscriminatorColumn="type", DiscriminatorType="String", DiscriminatorValue="NA")] public abstract class Company<T> : ActiveRecordBase<T>, ICompany { [PrimaryKey] private int Id { get; set; } [Property] public String Name { get; set; } } [ActiveRecord(DiscriminatorValue="firm")] public class Firm : Company<Firm> { [Property] public string Description { get; set; } } [ActiveRecord(DiscriminatorValue="client")] public class Client : Company<Client> { [Property] public int ChargeRate { get; set; } } This works fine for most cases. I can do things like: var x = Client.FindAll(); But sometimes I want all of the companies. If I was not using generics I could do: var x = (Company[]) FindAll(Company); Client a = (Client)x[0]; Firm b = (Firm)x[1]; Is there a way to write a FindAll that returns an array of ICompany's that can then be typecast into their respective types? Something like: var x = (ICompany[]) FindAll(Company<ICompany>); Client a = (Client)x[0]; Or maybe I am going about implementing the generic support all wrong?

    Read the article

  • Using content from the project in tests

    - by oillio
    I am working with Visual Studio 2010 and it's integrated testing functionality. I have an XML file in my project which is set to copy to the output directory. I can access the file just fine when I compile and run the project. But it doesn't exist when I attempt to access it within a TestMethod. It looks like the test is run with the working directory set to an "Out" directory created within the TestResults directory. I can set a breakpoint before I use the file. If I then copy the file into this "Out" directory and continue running the test it accesses the file properly. But that is not really how I want my automated tests to function. Is it possible to tell VS to copy the build directory into this working directory?

    Read the article

1