.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Imran Ghani
Post New Web Links

How do i pass my datacontract into my business layer without a circular reference????

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :WCF
 
Ok, this architecture is fairly new to me, so I need a few good pointers.  I've searched the topic, but still don't have a clear understanding on what I'm missing.   I have a presentation layer, which displays my data and forms. I have a WCF service, a business layer and a dataAccess Layer I am trying to read data from on OLD!! foxpro .dbf file.  I've read all the articles on why not pass Datasets, etc so I'm trying to learn how to pass data contracts.  I have the following in my WCF [ServiceContract] public interface IService1 { [OperationContract] void SaveNDFData(string storedprocedure, ndfContractLibrary.NDFDataParam[] ndfData); <strong>[OperationContract] List<ndfContractLibrary.NDFDRawData> getRawNDFD();</strong> } I have a separate library for my dataContracts as i know later I will have several.  I'm using this as a generic List<> [Serializable] [DataContract] public class NDFDRawData { private int batchNumber; [DataMember] public int BatchNumber { get { return batchNumber; } set { batchNumber = value; } } private int sampleNumber; [DataMember] public int SampleNumber { get { return sampleNumber; } set { sampleNumber = value; } } private decimal invitroHour; [Da


View Complete Post


More Related Resource Links

Easy UI Testing: Isolate Your UI Code Before It Invades Your Business Layer

  

The User Interface Process Application Block (UIP) from the Microsoft Patterns & Practices team can help you isolate your UI, write unit tests for your UI logic, and write a UI that really is the thin layer it was always meant to be. Mark Seemann shows you how it's done in this article.

Mark Seemann

MSDN Magazine August 2005


is there any impact of using static methods in Business Access layer in 3 tier applciation

  

is there any impact of using static methods in Business Access layer in 3 tier applciation,


Please suggest me what are the best practices and standards


Is it a good practice to use DataContract attributes on business entities

  
Hi Folks, Currently I am developing a framwork for travel industry and finally my framework will expose its operations in the form of WCF Service. I was wondering if it is a good idea to decorate your entities and class with DataContract attributes. I know this is required if you want your classes/fields to be serialized/deseralized.  However, by Adding these attributes mean you are making your entities service specific which I believe not a good idea. Service and domain specific entities should be seperate. One solution to this would be to make DTOs and decorate them with these attributes and this make sense as core purpose of these DTOs is serialization and deserialization. What can be other options....? Please share your thoughts. Thanks, Naeem

Circular Reference with Complex Type

  

I have created a webservice that returns a complex type.  This is the xml that is returned from the webservice:

<NinjaRouteEntity xmlns="http://tempuri.org/">
  <Entity NinjaRouteID="1" xmlns="">
    <AlwaysFetchToRegion>False</AlwaysFetchToRegion>
    <TimeFrameReturnsNewIfNotFound>True</TimeFrameReturnsNewIfNotFound>
    <AlwaysFetchFromRegion>False</AlwaysFetchFromRegion>
    <EntityCollectionReference PropertyName="PointCollectionViaNinjaRouteVector">
      <PointCollectionViaNinjaRouteVector>
        <Entities />
        <AllowRemove>False</AllowRemove>
        <AllowEdit>True

VWD Express Doesn't step into the Business Layer Function

  

Hi,

I have a solution that consists of some web projects and websites (seperate projects in one solution) When I run the main project and debug I want to step into a function that resides in another project as a business layer function and then step into another function in DAL project. I set breakpoints in both projects (DAL and BLL) but am not able to step into those functions!!!

What is the problem with vwd express, It should support such vital thing. 


VB code behind the Business Logic Layer ???

  

Hello. I was hoping for some general help and comments.

I went through a lot of the ASP.Net Web Forms Tutorials.

I also went though the whole "ASP.Net in 24 Hours" book by Scott Mictchell. I followed everything that went on in that book and built the final project successfully. I also used the tutorials here to better understand the whole Membership Provider/User tables setup that was going on in the book.

Next, I thought I would learn more about accessing data for ASP.Net since that is what most application do.

I went through the first Data Tutorial here. I seemed to understand what was going on just fine.

The second Data Tutorial seemed to just show a lot of VB code to build the Business Logic Layer. There was not much explanation about how to do it yourself.

I think I can keep going in the tutorials here. I downloaded the code from the second tutorial and went through it.I am guessing that the code in the second tutorial was given just to proceed with the overall project that is being built throughout the tutorial sequence.

I just wish I understood what is going on in those long lists of VB code. I can see some of what is going on. I don't know VB very well at all. So, what is the next step?

I have started working through a VB book. Will learning VB help me understand the code in that tu

Exposing business layer classes in the service (a lot of classes, all one-to-one with the service)

  

So I have a lot of classes in my business layer which may change over time and  I'd like to expose them in the service layer with as little work as possible. Exposing manually isn't something I want to do because every business class will have all of its properties exposed, meaning I'd be coding the same thing twice (and there are a lot of classes).

I saw an MSDN video where it was suggested writing a helper class but they didn't really delve in to how it would work.

Has anyone got any idea of how to go about this?

Many thanks,

Thomas


How can I pass parameters to my Business Data Column?

  
I have a custom list in which I have created a  Business Data Column that pulls data from a web service.  I have written the ADF file, it is installed on the server and I can get to the service's fields via the Business Data Type picker. However, and this is the part I can't figure out how to do: the web service requires 2 parameters be passed to it.  These parameters exist in other fields of the list item.  How do I make that association and pass those parameters?  Is this possible?

Also, I have not delved into using Visual Studio yet for SharePoint development, so I only have the UI and Designer as my tools.  I am on MOSS 2007.

Edit - I found this article: http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-4-of-8.  Toward the bottom it explains how to do a 1:1 mapping of the list item to, in his example, the database item.  This is similar to what I need to do, except mine is a web service and it requires two parameters to identify it.

How much web layer input (ex. GridView DataKeys) should be validated in the business layer?

  

Back in the day when we were mostly submitting forms from one page to another we used to have to validate all post parameters to make sure that the ids somehow belonged to the user that was currently logged in.  After all you didn't want a "hacker" to be able to pull someone else's information.  In modern ASP.NET application in a situation where a lot of these keys are part of server controls (ex DataKeys of GridView) and is stored in ViewState which is supposedly stamped with a hash that gets validated on every post back, does anyone still validate that the key that was retrieved in fact belongs to the user?

I currently do, my business layer methods tend to take an instance of a "profile" object that is maintained in session for each user, the profile contains all basic information including the company etc. that the user is associated with.  Having the profile in every business method I can validate that any piece of information requested by the web layer from the business layer does in fact belong to the user requesting it.  Another thought is that the library (business layer) can also be reused outside of ASP.NET where perhaps the input would not be as secure.  I am wondering if all of this is overkill as all of my basic GetSomething() methods tend to have extra trips to the database to make sure that an ID

How to pass control reference to its property in data binding expression

  

Here is data binding expression (dropdown list is nested in gridview)

<asp:DropDownList ID="ddlEmployees" 
         runat="server" 
         DataSource='<%# PayCheckBO.GetEmployeesNameIdPair() %>' 
         DataTextField="Text" 
         DataValueField="Value" 
         SelectedIndex='<%# GetSelectedIndex(HOW TO PASS REF of ddlemployee HERE)%>'/>

Code Behind has function which looks like

public int GetSelectedIndex(DropDownList ddl)
{
        //loop through the item in the dropdownlist
        //return index based on xyz checks
}

The whole reason for passing the reference is to save round trip to database and not to use SESSION


Server.MapPath dont have access to web all calls made in business layer

  

Hi Guys,

I'm trying to find a way to map a path to a pdf object in my business layer.. im using nop commerce and their messagemanager class is in the business layer and all calls to email queuing and the like are done in the business layer..


i would love to know if there's a way to do it without having the ability to pass the path in from the web layer..


my backup plan is an appsetting in web.config.. but hoped it wouldn't come to that?!


Using Dynamic Data against Business Layer

  

 Greetings, 

Has anyone successfully used Dynamic Data against their business object.  I found a snipet of code that used Microsoft.Web.DynamicData from the Dynamic Data Futures sample project to bind to an object called AggregateData but importing the assembly causes ambigous references amoung other errors.

Also I have a Repository model (ProductManager in my case) that performs all the CRUD with business logic against the Entity Framework.  I would like to use my ProductManager object directly with the Dynamic Data rather than using the ObjectContext directly.  The sample shows an example of using the DynamicObjectDataSource which references the business object.  

My primary question is how can I accomplish this using the latest version of Dynamic Data from DynamicDataPreview4.  Does anyone have a sample connecting to a business object via the normal ObjectDataSource included with VS 2008 SP1. 

<

remoting: pass existing reference instead of new

  
please forgive my newbie-ness ...

i have a server, implemented by:

'+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+ 
        'Create an instance of a channel 
        serverChannel = New System.Runtime.Remoting.Channels.Ipc.IpcServerChannel("csif") 
        System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(serverChannel, False) 
 
        'Register as an available 

A better way to reference your wizard steps using named steps

  
Note: this article uses the plain vanilla but the concepts apply equally well to its popular counterpart .

By far the most common way that I see wizard steps reference in code snippets is by their index.

Business Modelling and Web Applications and extending UML

  
UML can be used to model a business, prior to automating it with computers. The same basic UML syntax is used, however, a number of new symbols are added, in order to make the diagrams more relevant to the business process world. A commonly-used set of these symbols is available in current versions of Rational Rose.

How to Pass Values Between Web Pages ASP.NET

  
You can pass information between pages in various ways, some of which depend on how the redirection occurs. The following options are available even if the source page is in a different ASP.NET Web application from the target page, or if the source page is not an ASP.NET Web page:

Use a query string.

Get HTTP POST information from the source page.

The following options are available only when the source and target pages are in the same ASP.NET Web application.

Use session state.

Create public properties in the source page and access the property values in the target page.

Get control information in the target page from controls in the source page.

How to Pass Values Between ASP.NET Web Pages

  
You can pass information between pages in various ways, some of which depend on how the redirection occurs. The following options are available even if the source page is in a different ASP.NET Web application from the target page, or if the source page is not an ASP.NET Web page:

Use a query string.

Get HTTP POST information from the source page.

The following options are available only when the source and target pages are in the same ASP.NET Web application.

Use session state.

Create public properties in the source page and access the property values in the target page.

Get control information in the target page from controls in the source page.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend