Search Results

Search found 13 results on 1 pages for 'chobo'.

Page 1/1 | 1 

  • What is the web.debug.config and web.release.config file for?

    - by chobo
    Hi, I just upgraded to VS 2010 and MVC 2.0 and I noticed the web.config has two additional files attached to it? Are thee files used to specify debug and release specific settings, so you don't clutter up the main web.config? Does it even make sense to place a connection string in the root web.config file if I have have a local and remote one in the debug and release web.configs respectively. Thanks!

    Read the article

  • Where and how to validate and map ViewModel?

    - by chobo
    Hi, I am trying to learn Domain Driven Design and recently read that lots of people advocate creating a ViewModels for your views that store all the values you want to display in a given view. My question is how should I do the form validation? should I create separate validation classes for each view, or group them together? I'm also confused on what this would look like in code. This is how I currently think validation and viewmodels fit in to the scheme of things: View (some user input) - Controller - FormValidation(of ViewModel) - (If valid map to ViewModel to Domain Model) - Domain Layer Service - Infrastructure Thanks! P.S. I use Asp.net MVC with C#

    Read the article

  • How to reference other Areas?

    - by chobo
    Hi, I have a controller called "Account" in my main site and I would like to reference a method on it from with in an Asp.net MVC 2 Area. It seems by default that Areas only have access to the controllers within that Area which makes sense, but there doesn't seem to be an option to reference controllers from another area. Thanks!

    Read the article

  • How would you organize this in asp.net mvc?

    - by chobo
    I have an asp.net mvc 2.0 application that contains Areas/Modules like calendar, admin, etc... There may be cases where more than one area needs to access the same Repo, so I am not sure where to put the Data Access Layers and Repositories. First Option: Should I create Data Access Layer files (Linq to SQL in my case) with their accompanying Repositories for each area, so each area only contains the Tables, and Repositories needed by those areas. The benefit is that everything needed to run that module is one place, so it is more encapsulated (in my mind anyway). The downside is that I may have duplicate queries, because other modules may use the same query. Second Option Or, would it be better to place the DAL and Repositories outside the Area's and treat them as Global? The advantage is I won't have any duplicate queries, but I may be loading a lot of unnecessary queries and DAL tables up for certain modules. It is also more work to reuse or modify these modules for future projects (though the chance of reusing them is slim to none :)) Which option makes more sense? If someone has a better way I'd love to hear it. Thanks!

    Read the article

  • Need help deciphering JQuery example

    - by chobo
    I just started learning JQUery and OO Javascript, so I am trying to figure out which belongs to which and what they do. I came across this code in the JQuery documentation (function($sub) { $sub // a subclass of jQuery $sub === jQuery; //= false $sub.fn.myCustomMethod = function(){ return 'just for me'; } $sub(document).ready(function() { $sub('body').myCustomMethod(); //= 'just for me' }); })(jQuery.subclass()); Questions: Why is (function surrounded by () ? What does this mean (jQuery.subclass()); ? Is this a JQuery thing or part of regular javascript? Thanks

    Read the article

  • How much to put in a Repository class?

    - by chobo
    When using the repository pattern is it recommended to have one Repository class for each database table? Would I also map one service layer class to one repository class. I'm having a hard time trying to understand how much stuff one repository or service layer class should have. Thanks!

    Read the article

  • Using Forms authentication with remote auth system?

    - by chobo
    I am working on a website that uses a remote websites database to check for authentication (they are both share some database tables, but are separate website...) Right now I check the username and password against the remote websites account / member table, if there is a match I create a session. Questions: Is this secure? On authenticated pages I just check if a session of a specific type exists.Is it possible for someone to create an empty session or something that could bypass this? Is it possible to use Forms authentication with this setup? Right now if a user is authenticated I just get an object back with the username, email and id.

    Read the article

  • What would be the best approach for this?

    - by chobo
    I have a site which has an area that requires authentication. Right now I use the roles attribute on all the controllers in that area, and I run a query to retrieve that users ID, and all their settings. It seems like a code or design smell to me that I am retrieving the userid and settings each time a controller in that area loads up? I'm not sure if I should be using sessions, or if ASP.Net MVC 2.0 provides some unique way to handle this. Another concern is security. Overall, I don't really know which way to turn. Design wise I would like the userId and settings retrieved only once when the user logs into the area. Right now I grab the userId each time a controller loads up, and then if required, I query the database for their settings each time as well.

    Read the article

  • Unit testing with Data Access Layer

    - by chobo
    Hi, what is a good way to write unit tests with a LINQ to SQL DAL? Currently I am doing some database testing and need to create helper methods that access the database, but I don't want those methods in my main repo's. So what I have is two copies of the DAL, one in my main project and one in the Test project. Is it easier to manage these things if I create a separate project for the data layer? I'm not sure which way is a better way to approach this. If I do create a data layer project would I move all my repo's to that project as well? I'm not sure how to properly setup the layers. Thanks

    Read the article

  • Session vs singleton pattern

    - by chobo
    Hi, I have a web application where I would like to pull user settings from a database and store them for Global access. Would it make more sense to store the data in a Singleton, or a Session object? What's the difference between the two? Is it better to store the data as an object reference or break it up into value type objects (ints and strings)? Thanks!

    Read the article

  • Why does the check for an interface fail?

    - by chobo
    I have a class that implements an interface. In another area of the code I check if that class instance contains that interface, but it doesn't work. The check to see if the class contains the interface always fails (false) when it should be true. Below is a simple representation of what I am trying to accomplish. Example public interface IModel { bool validate(); } public class SomeModel : IModel { public SomeModel { } public bool Validate() { return true; } } // Dummy method public void Run() { SomeModel model = new SomeModel(); if (model is IModel) { string message = "It worked"; } else { string message = "It failed"; } }

    Read the article

  • How to write stored procedure to do this?

    - by chobo
    I would like to create a stored procedure that takes in a string of comma separated values like this "1,2,3,4", and break it apart and use those numbers to run a query on a different table. so in the same stored procedure it would do something like select somefield from sometable where somefield = 1 select somefield from sometable where somefield = 2 select somefield from sometable where somefield = 3 select somefield from sometable where somefield = 4 Thanks!

    Read the article

1