#PARAN SILVERLIGHT#
  • Tistory
    • 관리자
    • 글쓰기
Carousel 01
Carousel 02
Previous Next

LinQPad

FRAMEWORK/LightSwitch 2013. 4. 24. 21:02

Odata 를 Linq를 작성해서 바로 데이타를 볼수 있는 툴  좋다. ^^

 

In this article we will cover the simplest scenarios for connecting to LightSwitch using OData. We will not cover, inserting, updating, deleting, or validation.

The Application

clip_image001

We start with a simple LightSwitch application that contains a few Entities (tables) and Screens.

clip_image002

We Publish the application.

clip_image003

We enter some sample data.

Connecting To LightSwitch Using OData

clip_image004

We change the URL that we use to get to the application …

clip_image005

… to a URL with ApplicationData.svc.

clip_image006

This will allow us to see the OData Feed.

Using LinqPad

clip_image007

We can download and install LinqPad from: http://www.linqpad.net/.

clip_image008

We add a connection.

clip_image009

We select OData.

clip_image010

We enter the URL and click OK.

clip_image011

The Entities will show.

We can use the following query (in C# Statement(s) mode):

 

var DozenRedRoses = 
from Product in Products
where Product.ProductName == "Dozen Red Roses"
select Product;
DozenRedRoses.Dump("The Dozen Red Roses");
// Set Product ID
var intProductID = DozenRedRoses.FirstOrDefault().Id;
var OrderDetailsForRoses = 
from OrderDetail in OrderDetails
where OrderDetail.Product.Id == intProductID
where OrderDetail.Quantity > 1
select OrderDetail;
OrderDetailsForRoses.Dump("The order details for more than 2 roses");
// Get Order Detail IDs
List<int> OrderDetailIDs = new List<int>();
foreach (var element in OrderDetailsForRoses)
{
	OrderDetailIDs.Add(element.OrderDetail_Order);
}
foreach (var element in OrderDetailIDs)
{
	var OrderForRoses = 
	from Order in Orders
	where Order.Id == element 
	select Order;
	
	OrderForRoses.Dump("A order for more than 2 Red Roses");
}

 

To produce this result:

clip_image012

Security

clip_image013

We can enable Forms Authentication and deploy the application again.

clip_image014

When we try to navigate to the OData methods it prompts us for a valid account.

 

참조 :

http://lightswitchhelpwebsite.com/Blog/tabid/61/EntryId/114/Accessing-Your-Visual-Studio-2011-LightSwitch-Application-Using-OData.aspx

저작자표시 비영리 (새창열림)
블로그 이미지

파란실버라이트

To remember the time when I started learning Silver Light!

,

카테고리

  • Inforamtion Technology (281)
    • DESIGN PATTERN (33)
      • 실용주의 디자인패턴 (29)
    • SOFTWARE ENGINEERING (21)
      • Art Of Readable Code (12)
      • Object Oriented Programming (6)
      • TDD (2)
    • FRAMEWORK (22)
      • Spring.net (2)
      • LightSwitch (20)
    • PROGRAMING (58)
      • C# (20)
      • .NET (6)
      • HTML5 (7)
      • ASP.NET (9)
      • SILVERLIGHT (7)
      • Ruby On Rails (6)
    • PROJECT MANAGEMENT (10)
      • SW Version Management (7)
      • Schedulring Management (1)
    • BOOKS (18)
    • MOBILE APP (1)
      • SENCHA TOUCH (1)
    • SECURITY (5)
    • MES (1)
    • B2B (14)
      • WEBMETHODS (4)
    • ERP (53)
      • SAP/R/3 (51)
    • ABOUT TOOLS (2)
    • FUNDAMENT CONCEPT (21)
    • SOA BPM (22)
    • PORTFOLIO (0)

태그목록

  • 동시성
  • 프로그래밍
  • 병렬

최근에 받은 트랙백

글 보관함

링크

파란실버라이트

블로그 이미지

To remember the time when I started learning Silver Light!

LATEST FROM OUR BLOG

RSS 구독하기

LATEST COMMENTS

BLOG VISITORS

  • Total :
  • Today :
  • Yesterday :

Copyright © 2015 Socialdev. All Rights Reserved.

티스토리툴바