This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Response Search(SearchModel search) | |
{ | |
Dictionary<string, Expression> expressions = new Dictionary<string, Expression> | |
{ | |
{"Price", (Expression<Func<Phone, double>>) (p => p.Price)}, | |
{"Brand", (Expression<Func<Phone, string>>) (p => p.Name)} | |
}; | |
BdPhonesDbEntities db = new BdPhonesDbEntities(); | |
IQueryable<Phone> phones = db.Phones.Where(search.GetExpression()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace XmlParserLibrary | |
{ | |
public class MyXmlParser | |
{ | |
public string GetValue(string node) | |
{ | |
String s = ""; | |
if (node.StartsWith("<xml>") && node.EndsWith("</xml>")) | |
{ | |
s = node.Split(new[] {"<xml>"},StringSplitOptions.None)[1].Split(new []{"</xml>"}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Assert; | |
import org.junit.Test; | |
import static org.junit.Assert.*; | |
public class MyXmlParserTest { | |
@Test | |
public void testGetValue() throws Exception { | |
MyXmlParser class1 = new MyXmlParser(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by foyzul.karim on 6/5/2014. | |
*/ | |
public class MyXmlParser { | |
public String getValue(String node ) | |
{ | |
String s=""; | |
if (node.startsWith("<xml>") && node.endsWith("</xml>")) | |
{ | |
s = node.split("<xml>")[1].split("</xml>")[0]; |
NewerOlder