using System.Linq;
using Kushatpodano.Ru.Models;
namespace Kushatpodano.Ru.Classes.BusinessLayer
{
public class CustomPages
{
private readonly KushDBDataContext context = new KushDBDataContext();
public static string PageText( string ActionResult)
{
return ( from p in context.CustomPages
where p.ActionResult == ActionResult
select p).Single().PageText;
}
public static string PageTitle( string ActionResult)
{
return ( from p in context.CustomPages
where p.ActionResult == ActionResult
select p).Single().PageTitle;
}
}
}
* This source code was highlighted with Source Code Highlighter .
using System.Linq;
using Kushatpodano.Ru.Models;
namespace Kushatpodano.Ru.Classes.BusinessLayer
{
public class CustomPages
{
public static string PageText( string ActionResult)
{
string PageText;
using (KushDBDataContext context = new KushDBDataContext())
{
PageText = ( from p in context.CustomPages
where p.ActionResult == ActionResult
select p).Single().PageText;
}
return PageText;
}
public static string PageTitle( string ActionResult)
{
string PageTitle;
using (KushDBDataContext context = new KushDBDataContext())
{
PageTitle = ( from p in context.CustomPages
where p.ActionResult == ActionResult
select p).Single().PageTitle;
}
return PageTitle;
}
}
}
* This source code was highlighted with Source Code Highlighter .
Source: https://habr.com/ru/post/67207/
All Articles